package service.script.builtin;

import communication.CommunicationHelper;
import communication.MessageHelper;
import communication.ParameterizedMessage;

import service.AbstractService;
import service.ServiceRequestHandler;
import service.script.ScriptExecutionService;

public class WriteLogRequestHandler  extends ServiceRequestHandler {

	public WriteLogRequestHandler(AbstractService service) {
		super("ScriptExecutionService::WriteLog", service);
	}

	@Override
	public ParameterizedMessage handle(ParameterizedMessage message) {
		String log = (String) message.getAttachment();
		ScriptExecutionService service = (ScriptExecutionService) this.getService();
		service.writeLog(log);
		
		return MessageHelper.buildSuccessMessage();
	}

}
